<template>
  <div class="admin-head">
    <el-col :span="10">
      <h1 class="head-h1">Ford后台管理系统</h1>
    </el-col>
    <el-col :span="3" class="btn-col">
      <el-button type="info" circle @click="screenfullClick"
        ><el-icon><FullScreen /></el-icon
      ></el-button>
      <el-button type="primary" class="return-btn" @click="returnhome"
        >返回</el-button
      >
    </el-col>
  </div>
</template>

<script>
import { FullScreen } from "@element-plus/icons-vue";

import screenfull from "screenfull";

export default {
  components: {
    FullScreen,
  },
  data() {
    return {
      isFullscreen : false
    }
  },
  methods: {
    returnhome() {
      this.$router.push("/home");
    },
    currentScreen() {
      if (screenfull.isFullscreen !== this.isFullscreen.value)
        this.isFullscreen = screenfull.isFullscreen;
    },
    screenfullClick() {
      if (screenfull.isEnabled) screenfull.toggle();
    }
  },
  onMounted() {
    window.addEventListener("resize", this.currentScreen);
  },
  onUnmounted() {
    window.removeEventListener("resize", this.currentScreen);
  },
};
</script>

<style scoped>
.admin-head {
  max-width: 1100px;
  height: 100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.head-h1 {
  line-height: 100px;
  color: whitesmoke;
  font-size: 45px;
}
.btn-col {
  /* background-color: red; */
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.return-btn {
  /* width: 100px; */
  /* height: 100px; */
  background-color: rgb(0, 141, 127);
  margin: auto 0;
  border: none;
  border-radius: 10px;
}
@media screen and (max-width: 821px) {
  .head-h1 {
    font-size: 35px;
    text-align: center;
  }
}
</style>